package com.example.myapp;

import androidx.appcompat.app.AppCompatActivity;
import androidx.core.view.GestureDetectorCompat;

import android.app.Activity;
import android.os.Bundle;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    private GestureDetectorCompat delectorCompat;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }
public boolean onTouchEvent(MotionEvent event){

  
    delectorCompat.onTouchEvent(event);
        return super.onTouchEvent(event);
}
    public void click(View view) {
        Toast.makeText(this,"按钮点击",Toast.LENGTH_SHORT).show();
    }

    public void floatclick(View view) {
        Toast.makeText(this,"浮动按钮点击",Toast.LENGTH_SHORT).show();
    }

    public void imagesclick(View view) {
        Toast.makeText(this,"图片按钮点击",Toast.LENGTH_SHORT).show();
    }
}